// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#pragma once

#include "targetver.h"

#include <stdio.h>
#include <tchar.h>
#include <stdlib.h>
#include <conio.h>

#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS      // some CString constructors will be explicit

#include <atlbase.h>
#include <atlstr.h>
#include <atlcom.h>

#define SECURITY_WIN32

#include <windows.h> 
#include <winsock2.h>
#include <wincrypt.h>
#include <wintrust.h>
#include <schannel.h>
#include <security.h>
#include <sspi.h>

#include "gmslib.h"
#include "apns.h"

#define IO_BUFFER_SIZE  0x10000
#define DLL_NAME TEXT("Secur32.dll")
#define NT4_DLL_NAME TEXT("Security.dll")

using namespace ATL;

class CAPNSModule : public CAtlModule
{
public:
    CAPNSModule()
    {
        m_hInstance = NULL;
    }

    //DECLARE_LIBID(__uuidof(XortAddinLib))

    inline HINSTANCE GetResourceInstance()
    {
        return m_hInstance;
    }

    inline void SetResourceInstance(HINSTANCE hInstance)
    {
        m_hInstance = hInstance;
    }

    virtual HRESULT AddCommonRGSReplacements(_Inout_ IRegistrarBase* /*pRegistrar*/) throw() 
    {
        return E_NOTIMPL;
    }

private:
    HINSTANCE m_hInstance;
};

extern CAPNSModule _AtlModule;

void ShowVerifyTrustError( DWORD hr );
void ShowSecurityError( DWORD hr );